<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
<!--
.my_class {
	width:449px;
	height:auto;
content-box;
 	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
}



<script type="text/javascript" src=" http://code.jquery.com/jquery-1.5.2.min.js"></script>


<script type="text/javascript">
$(document).ready(function(){
  :name = $("#divs").val;
  $("textarea").html("<textarea name=" + x + ">");
});
</script>
-->
</style>
</head>
    <d%= f.text_area :name %><br />
<body>
<%= form_for(@test) do |f| %>

<script type="text/javascript">
function Submit(){
document.getElementById("test_name_a").value=document.getElementById("test_name").innerHTML;
}
</script> 
  <% if @test.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@test.errors.count, "error") %> prohibited this test from being saved:</h2>
      <ul>
      <% @test.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :name %><br />
    <%= f.text_area:name ,:id=>"test_name_a" ,:style=>"display:none" %>
    <div contentEditable id="test_name" onkeydown="edit(this.innerHTML)"   class="my_class" >fdsfsdf</div>        
</div>
<SCRIPT LANGUAGE="JavaScript">
function edit(html)
{
        if(event.keyCode==13){
       var   textRange=document.selection.createRange();   
      textRange.text="\r\n";   
      textRange.select();   
      event.returnValue=false;
    }
}
</SCRIPT>

  <div class="actions">
    <%= submit_tag "fd",:onClick=>"javascript:Submit();"%>
  </div>
<% end %>

</bodu>
